<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html class="x-admin-sm">

<head>
  <meta charset="UTF-8">
  <title>后台管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
    content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  <link rel="stylesheet" href="/admin/static/css/font.css">
  <link rel="stylesheet" href="/admin/static/css/xadmin.css">
  <script type="text/javascript" src="/admin/static/js/jquery.min.js"></script>
  <script type="text/javascript" src="/admin/static/lib/layui/layui.js" charset="utf-8"></script>
  <script type="text/javascript" src="/admin/static/js/xadmin.js"></script>
  <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
  <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
  <div class="x-nav">
    <span class="layui-breadcrumb">
      <a href="">团队成员</a>
      <a>
        <cite>成员管理</cite></a>
    </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="layui-icon" style="line-height:30px">ဂ</i></a>
  </div>
  <div class="x-body">
    <xblock>
      <button class="layui-btn" onclick="x_admin_show('添加用户','/admin/member/member-add',720,550)"><i
          class="layui-icon"></i>添加</button>
      <span class="x-right" style="line-height:40px">共有数据：${total} 条</span>
    </xblock>
    <table class="layui-table x-admin">
      <thead>
        <tr>
          <th>ID</th>
          <th>姓名</th>
          <th>职称</th>
          <th>职务</th>
          <th>学历</th>
          <th>邮箱</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
      <c:forEach items="${memberList}" var="item">

        <tr>
          <td>${item.id}</td>
          <td>${item.name}</td>
          <td>${item.positionalTitle}</td>
          <td>${item.subMenuId}</td>
          <td>${item.education}</td>
          <td>${item.email}</td>
          <td class="td-manage">
            <button class="layui-btn layui-btn layui-btn-xs"
                    onclick="x_admin_show('编辑','/admin/member/member-edit?id=${item.id}',720,550)"><i class="layui-icon">&#xe642;</i>修改
            </button>
            <button class="layui-btn-danger layui-btn layui-btn-xs delete-btn" href="javascript:;" >
              <i class="layui-icon">&#xe640;</i>删除
            </button>
            <form action="/admin/member/delete" method="post" style="display: none">
              <input type="text" name="id" value="${item.id}">
            </form>
          </td>
        </tr>

      </c:forEach>
      </tbody>
    </table>
    <div class="page">
      <div>
        <c:if test="${current != 1}">
        <a class="prev" href="/admin/pages/members/member?page=${current-1}">&lt;&lt;</a>
        </c:if>
        <c:forEach begin="1" end="${pages}" varStatus="i">
          <c:if test="${current == i.index}">
            <span class="current">${i.index}</span>
          </c:if>
          <c:if test="${current != i.index}">
            <a class="num" href="/admin/pages/members/member?page=${i.index}">${i.index}</a>
          </c:if>
        </c:forEach>

        <c:if test="${current != pages}">
        <a class="next" href="/admin/pages/members/member?page=${current+1}">&gt;&gt;</a>
        </c:if>
      </div>
    </div>

  </div>
  <script>
    $('.delete-btn').click(function() {
      $(this).next().submit();
    });
  </script>
</body>

</html>